/*
 * @Descripttion: 全局数据
 * @version: 
 * @Author: jwZhang
 * @Date: 2020-04-30 10:28:26
 * @LastEditors: jwZhang
 * @LastEditTime: 2020-05-09 20:24:29
 */

import 'package:cloud_music/route/navigate_service.dart';
import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:get_it/get_it.dart';

class Application {
  static Router router;
  static GlobalKey<NavigatorState> key = GlobalKey();
  static SharedPreferences sp;
  static double screenWidth;
  static double screenHeight;
  static double statusBarHeight;
  static double bottomBarHeight;
  // https://blog.csdn.net/unicorn97/article/details/100769418
  static GetIt locator = GetIt.instance; //依赖注入

  static initSp() async {
    // SharedPreferences 存储用户信息到本地
    sp = await SharedPreferences.getInstance();
  }

  static setupLocator() {
    // 创建一个全局的 NavigateService  Locator
    locator.registerSingleton(NavigateService());
  }
}
